package com.next.aappublicapp;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.webkit.WebView;

/**
 * Activity which displays a login screen to the user, offering registration as
 * well.
 */
public class JanlokPalActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_janlokpal);
		
			
		WebView mWebView = (WebView)findViewById(R.id.webView);
	    mWebView.getSettings().setJavaScriptEnabled(true);
	    mWebView.getSettings().setPluginsEnabled(true);
	    String language = null;
	    String hindi = this.getString(R.string.Hindi);
	    if(getIntent().getExtras() != null){
		    language = getIntent().getExtras().getString("Language");
	    }
	    if(language == null){
	    	language = "English";
	    }
	    if(language.equals(hindi)){
	    	mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url=http://internal.aamaadmiparty.org/images/Jan_Lokpal_Bill_ver_2_3.pdf");
	    }else{
	    	mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url=http://internal.aamaadmiparty.org/images/Jan_Lokpal_Bill_ver_2_3.pdf");	
	    }
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		getMenuInflater().inflate(R.menu.swaraj, menu);
		return true;
	}

}
